﻿@namespace ERP.Blazor
@using System.Text.Json;
@using ERP.Abp.Identity
@using ERP.Blazor.Models;
@using ERP.Workflow.Designer.Application.Contracts

@inject IOptions<ProSettings> ProSettings


<div class="custom-table" id="@_guid">
    <div class="search">
          <Alert Message="正在用情怀努力开发中，请多关注。进行中（admintable组件+表单组件）。基础组件、布局规范-->流程设计器-->流程审批-->人事-->薪酬-->财务-->其他" Type="@AlertType.Success"  Closable Style="margin-bottom:5px" OnClose="ExpandSearch" />
  
  <RadioGroup @bind-Value="Term"  Style="margin:5px;" >
        <Radio RadioButton Value="@("A")">正式（100）</Radio>
        <Radio RadioButton Value="@("B")">离职（100）</Radio>
        <Radio RadioButton Value="@("C")">当月入职(8)</Radio>
        <Radio RadioButton Value="@("C")">当月离职（10）</Radio>
    </RadioGroup>
        <AntDesign.Form @ref="_form" Model="formData" Name="advanced_search" Class="ant-advanced-search-form">
            <AntDesign.Row Gutter="24">
                @for (var i = 0; i < (_expand ? 10 : 3); i++)
                {
                    var index = i;
                    <AntDesign.GridCol Span="8" @key="index">
                        <FormItem Label="@($"Field {index}")">
                            <AntDesign.Input @bind-Value="@(context[$"field-{index}"].Value)" Placeholder="placeholder" />
                        </FormItem>
                    </AntDesign.GridCol>
                }
            </AntDesign.Row>
        </AntDesign.Form>
    </div>
    <div  class="toolbar">
            <span class="title"> <Tag PresetColor="@PresetColor.Blue">当期</Tag>  <span class="ant-descriptions-title">@Term @*<DatePicker  OnChange="dateChange" TValue="DateTime?" Picker="@DatePickerType.Month" /> *@</span> 
        
            <span class="ant-comment-content-author-name">考勤周期3月26 至 4月25</span>
        </span>


@*
        <Space>
    <SpaceItem>
        Space
    </SpaceItem>
    <SpaceItem>
        <Button Type="primary">Button</Button>
    </SpaceItem>
    <SpaceItem>
        <Button>
            <Icon Type="upload" Theme="outline" /> Click to Upload
        </Button>
    </SpaceItem>
    <SpaceItem>
        <Button>Confirm</Button>
    </SpaceItem>
</Space>
*@

        <AntDesign.Space Class="right">
            <AntDesign.SpaceItem>
               <AntDesign.ButtonGroup>
                    <AntDesign.Button Type="primary" >业务1</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">业务2</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">业务3</AntDesign.Button>
                </AntDesign.ButtonGroup>
                  </AntDesign.SpaceItem>
             <AntDesign.SpaceItem>
                       <AntDesign.ButtonGroup>
                            <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">提交</AntDesign.Button>
                            <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">驳回</AntDesign.Button>
                            <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">撤回</AntDesign.Button>
                            <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">传阅</AntDesign.Button>
                            <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">转交</AntDesign.Button>
                              <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">评论</AntDesign.Button>
                        </AntDesign.ButtonGroup>
            </AntDesign.SpaceItem>
           <AntDesign.SpaceItem>
                <AntDesign.ButtonGroup>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">新增</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">删除</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">编辑</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_visibleModal=true;}">导出</AntDesign.Button>
                </AntDesign.ButtonGroup>
             </AntDesign.SpaceItem>
               <AntDesign.SpaceItem>
                    <AntDesign.ButtonGroup>
                     <AntDesign.Button Type="primary" HtmlType="submit" >查询</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="(e)=>ResetTableHeight()">折叠</AntDesign.Button>
                    <AntDesign.Button Type="primary" OnClick="()=>{_form?.Reset();}">清除</AntDesign.Button>
                    <Dropdown >
		
</Dropdown>
<Dropdown>
    <Overlay>
        <Menu>
            <MenuItem>
                <a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
                    1st menu item
                </a>
            </MenuItem>
            <MenuItem>
                <a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
                    2nd menu item
                </a>
            </MenuItem>
            <MenuItem>
                <a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
                    3rd menu item
                </a>
            </MenuItem>
        </Menu>
    </Overlay>
    <ChildContent>
        <AntDesign.Button Type="primary" >
           更多<AntDesign.Icon Type="down" ></AntDesign.Icon>
        </AntDesign.Button>
    </ChildContent>
</Dropdown>


                </AntDesign.ButtonGroup>
             </AntDesign.SpaceItem>

        </AntDesign.Space>
    
        
    </div>
    <AntDesign.Table  
    ScrollBarWidth="8"
                     @ref="table"
                     Loading="_loading"
                     TItem="WeatherForecast"
                     DataSource="@forecasts"
                     Total="_total"
                     PageSize="@_pageSize"
                     PageIndex="@_pageIndex"
                     ScrollY="@_scrollY"
                     SelectedRows="@selectedRows"
                     Size="AntDesign.TableSize.Small" Bordered="true">
        <AntDesign.Selection Key="@(context.Id.ToString())" Fixed="left" />
      

        <AntDesign.ActionColumn   Align="ColumnAlign.Center" Title="操作">
            <Space>
                 <AntDesign.SpaceItem><AntDesign.Button Size="small" Danger OnClick="()=>Delete(context.Id)">Delete</AntDesign.Button></AntDesign.SpaceItem>
            </Space>
           
        </AntDesign.ActionColumn>

       

        <AntDesign.Column @bind-Field="@context.Date"
                          Format="yyyy-MM-dd"
                          Sortable Filterable="true"
                          SortDirections="new[] { SortDirection.Descending, SortDirection.Descending }" />
         
        <AntDesign.Column Title="Temp. (F)" Field="@context.TemperatureF" />
        <AntDesign.Column Title="Hot" Field="@context.Hot">
            <TitleTemplate>
                <Switch @bind-Value="@context.Hot" Size="SwitchSize.Small"></Switch>
            </TitleTemplate>
        </AntDesign.Column>
        <AntDesign.Column @bind-Field="@context.Summary" Sortable>
            <TitleTemplate>
               <Icon Type="setting" Theme="outline"/>
            </TitleTemplate>
        </AntDesign.Column>
    </AntDesign.Table>
</div>


 @code{
   
   
 } 